#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*/ *fopen(char *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, unsigned int);
unsigned int readnb(int, int /*<<< orphan*/ *, char *);
int main() {
  unsigned int read_bytes = 0;
  FILE *fp = fopen("./testtext.txt", "r");
  char *copybuf = (char *)malloc(128);
  read_bytes = readnb(4096 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(4096, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(4096 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(2048 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(2048, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(2048 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(1024 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(1024, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(1024 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(512 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(512, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(512 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(128 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(128, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(128 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(64 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(64, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(64 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(32 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(32, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(32 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(16 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(16, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(16 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(8 - 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(8, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(8 + 1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(1, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb(0, fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb((128 + 1), fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb((128 - 1), fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  read_bytes = readnb((128), fp, copybuf);
  printf("sup: read = %u\n", read_bytes);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xea3(%rip),%rdi
lea    0xeab(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xfff,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1000,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1001,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe2f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x7ff,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe0b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x800,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xde7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x801,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdc3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3ff,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd9f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x400,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd7b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x401,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd57(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1ff,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd33(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x200,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd0f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x201,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xceb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x7f,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xcc7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x80,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xca3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x81,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xc7f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x3f,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xc5b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x40,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xc37(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x41,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xc13(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1f,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xbef(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x20,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xbcb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x21,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xba7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0xf,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xb83(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x10,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xb5f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x11,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xb3b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x7,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xb17(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x8,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xaf3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x9,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xacf(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x1,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xaab(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %edi,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xa8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x81,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xa66(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x7f,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xa42(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x80,%edi
call   1060 <readnb@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xa1e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rdi
lea    0xebc(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,%r14
mov    $0x80,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    $0xfff,%edi
mov    %r14,%rsi
mov    %rax,%rdx
call   1060 <readnb@plt>
lea    0xe92(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1000,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1001,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7ff,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x800,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x801,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3ff,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x400,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x401,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1ff,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x200,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x201,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7f,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x80,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x81,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x3f,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x40,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x41,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1f,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x20,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x21,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0xf,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x10,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x11,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x8,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x9,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x81,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x7f,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x80,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1060 <readnb@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"./testtext.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"sup: read = %u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
%5 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %5, i32** %3
%6 = call i64 @malloc(i32 128)
%7 = inttoptr i64 %6 to i8*
store i8* %7, i8** %4
%8 = load i32*, i32** %3
%9 = load i8*, i8** %4
%10 = call i32 @readnb(i32 4095, i32* %8, i8* %9)
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = load i32*, i32** %3
%14 = load i8*, i8** %4
%15 = call i32 @readnb(i32 4096, i32* %13, i8* %14)
store i32 %15, i32* %2
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %3
%19 = load i8*, i8** %4
%20 = call i32 @readnb(i32 4097, i32* %18, i8* %19)
store i32 %20, i32* %2
%21 = load i32, i32* %2
%22 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = load i32*, i32** %3
%24 = load i8*, i8** %4
%25 = call i32 @readnb(i32 2047, i32* %23, i8* %24)
store i32 %25, i32* %2
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %3
%29 = load i8*, i8** %4
%30 = call i32 @readnb(i32 2048, i32* %28, i8* %29)
store i32 %30, i32* %2
%31 = load i32, i32* %2
%32 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %31)
%33 = load i32*, i32** %3
%34 = load i8*, i8** %4
%35 = call i32 @readnb(i32 2049, i32* %33, i8* %34)
store i32 %35, i32* %2
%36 = load i32, i32* %2
%37 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = load i32*, i32** %3
%39 = load i8*, i8** %4
%40 = call i32 @readnb(i32 1023, i32* %38, i8* %39)
store i32 %40, i32* %2
%41 = load i32, i32* %2
%42 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = load i32*, i32** %3
%44 = load i8*, i8** %4
%45 = call i32 @readnb(i32 1024, i32* %43, i8* %44)
store i32 %45, i32* %2
%46 = load i32, i32* %2
%47 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = load i32*, i32** %3
%49 = load i8*, i8** %4
%50 = call i32 @readnb(i32 1025, i32* %48, i8* %49)
store i32 %50, i32* %2
%51 = load i32, i32* %2
%52 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %51)
%53 = load i32*, i32** %3
%54 = load i8*, i8** %4
%55 = call i32 @readnb(i32 511, i32* %53, i8* %54)
store i32 %55, i32* %2
%56 = load i32, i32* %2
%57 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = load i32*, i32** %3
%59 = load i8*, i8** %4
%60 = call i32 @readnb(i32 512, i32* %58, i8* %59)
store i32 %60, i32* %2
%61 = load i32, i32* %2
%62 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%63 = load i32*, i32** %3
%64 = load i8*, i8** %4
%65 = call i32 @readnb(i32 513, i32* %63, i8* %64)
store i32 %65, i32* %2
%66 = load i32, i32* %2
%67 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %66)
%68 = load i32*, i32** %3
%69 = load i8*, i8** %4
%70 = call i32 @readnb(i32 127, i32* %68, i8* %69)
store i32 %70, i32* %2
%71 = load i32, i32* %2
%72 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %71)
%73 = load i32*, i32** %3
%74 = load i8*, i8** %4
%75 = call i32 @readnb(i32 128, i32* %73, i8* %74)
store i32 %75, i32* %2
%76 = load i32, i32* %2
%77 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %76)
%78 = load i32*, i32** %3
%79 = load i8*, i8** %4
%80 = call i32 @readnb(i32 129, i32* %78, i8* %79)
store i32 %80, i32* %2
%81 = load i32, i32* %2
%82 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %81)
%83 = load i32*, i32** %3
%84 = load i8*, i8** %4
%85 = call i32 @readnb(i32 63, i32* %83, i8* %84)
store i32 %85, i32* %2
%86 = load i32, i32* %2
%87 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %86)
%88 = load i32*, i32** %3
%89 = load i8*, i8** %4
%90 = call i32 @readnb(i32 64, i32* %88, i8* %89)
store i32 %90, i32* %2
%91 = load i32, i32* %2
%92 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %91)
%93 = load i32*, i32** %3
%94 = load i8*, i8** %4
%95 = call i32 @readnb(i32 65, i32* %93, i8* %94)
store i32 %95, i32* %2
%96 = load i32, i32* %2
%97 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %96)
%98 = load i32*, i32** %3
%99 = load i8*, i8** %4
%100 = call i32 @readnb(i32 31, i32* %98, i8* %99)
store i32 %100, i32* %2
%101 = load i32, i32* %2
%102 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %101)
%103 = load i32*, i32** %3
%104 = load i8*, i8** %4
%105 = call i32 @readnb(i32 32, i32* %103, i8* %104)
store i32 %105, i32* %2
%106 = load i32, i32* %2
%107 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %106)
%108 = load i32*, i32** %3
%109 = load i8*, i8** %4
%110 = call i32 @readnb(i32 33, i32* %108, i8* %109)
store i32 %110, i32* %2
%111 = load i32, i32* %2
%112 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %111)
%113 = load i32*, i32** %3
%114 = load i8*, i8** %4
%115 = call i32 @readnb(i32 15, i32* %113, i8* %114)
store i32 %115, i32* %2
%116 = load i32, i32* %2
%117 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %116)
%118 = load i32*, i32** %3
%119 = load i8*, i8** %4
%120 = call i32 @readnb(i32 16, i32* %118, i8* %119)
store i32 %120, i32* %2
%121 = load i32, i32* %2
%122 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %121)
%123 = load i32*, i32** %3
%124 = load i8*, i8** %4
%125 = call i32 @readnb(i32 17, i32* %123, i8* %124)
store i32 %125, i32* %2
%126 = load i32, i32* %2
%127 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %126)
%128 = load i32*, i32** %3
%129 = load i8*, i8** %4
%130 = call i32 @readnb(i32 7, i32* %128, i8* %129)
store i32 %130, i32* %2
%131 = load i32, i32* %2
%132 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %131)
%133 = load i32*, i32** %3
%134 = load i8*, i8** %4
%135 = call i32 @readnb(i32 8, i32* %133, i8* %134)
store i32 %135, i32* %2
%136 = load i32, i32* %2
%137 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %136)
%138 = load i32*, i32** %3
%139 = load i8*, i8** %4
%140 = call i32 @readnb(i32 9, i32* %138, i8* %139)
store i32 %140, i32* %2
%141 = load i32, i32* %2
%142 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %141)
%143 = load i32*, i32** %3
%144 = load i8*, i8** %4
%145 = call i32 @readnb(i32 1, i32* %143, i8* %144)
store i32 %145, i32* %2
%146 = load i32, i32* %2
%147 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %146)
%148 = load i32*, i32** %3
%149 = load i8*, i8** %4
%150 = call i32 @readnb(i32 0, i32* %148, i8* %149)
store i32 %150, i32* %2
%151 = load i32, i32* %2
%152 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %151)
%153 = load i32*, i32** %3
%154 = load i8*, i8** %4
%155 = call i32 @readnb(i32 129, i32* %153, i8* %154)
store i32 %155, i32* %2
%156 = load i32, i32* %2
%157 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %156)
%158 = load i32*, i32** %3
%159 = load i8*, i8** %4
%160 = call i32 @readnb(i32 127, i32* %158, i8* %159)
store i32 %160, i32* %2
%161 = load i32, i32* %2
%162 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %161)
%163 = load i32*, i32** %3
%164 = load i8*, i8** %4
%165 = call i32 @readnb(i32 128, i32* %163, i8* %164)
store i32 %165, i32* %2
%166 = load i32, i32* %2
%167 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %166)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"./testtext.txt\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [16 x i8] c"sup: read = %u\0A\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i64 @malloc(i32 128)
%3 = inttoptr i64 %2 to i8*
%4 = tail call i32 @readnb(i32 4095, i32* %1, i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %4)
%6 = tail call i32 @readnb(i32 4096, i32* %1, i8* %3)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = tail call i32 @readnb(i32 4097, i32* %1, i8* %3)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = tail call i32 @readnb(i32 2047, i32* %1, i8* %3)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %10)
%12 = tail call i32 @readnb(i32 2048, i32* %1, i8* %3)
%13 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = tail call i32 @readnb(i32 2049, i32* %1, i8* %3)
%15 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = tail call i32 @readnb(i32 1023, i32* %1, i8* %3)
%17 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = tail call i32 @readnb(i32 1024, i32* %1, i8* %3)
%19 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = tail call i32 @readnb(i32 1025, i32* %1, i8* %3)
%21 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = tail call i32 @readnb(i32 511, i32* %1, i8* %3)
%23 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %22)
%24 = tail call i32 @readnb(i32 512, i32* %1, i8* %3)
%25 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %24)
%26 = tail call i32 @readnb(i32 513, i32* %1, i8* %3)
%27 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = tail call i32 @readnb(i32 127, i32* %1, i8* %3)
%29 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = tail call i32 @readnb(i32 128, i32* %1, i8* %3)
%31 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = tail call i32 @readnb(i32 129, i32* %1, i8* %3)
%33 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = tail call i32 @readnb(i32 63, i32* %1, i8* %3)
%35 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%36 = tail call i32 @readnb(i32 64, i32* %1, i8* %3)
%37 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %36)
%38 = tail call i32 @readnb(i32 65, i32* %1, i8* %3)
%39 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = tail call i32 @readnb(i32 31, i32* %1, i8* %3)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %40)
%42 = tail call i32 @readnb(i32 32, i32* %1, i8* %3)
%43 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = tail call i32 @readnb(i32 33, i32* %1, i8* %3)
%45 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %44)
%46 = tail call i32 @readnb(i32 15, i32* %1, i8* %3)
%47 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %46)
%48 = tail call i32 @readnb(i32 16, i32* %1, i8* %3)
%49 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %48)
%50 = tail call i32 @readnb(i32 17, i32* %1, i8* %3)
%51 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %50)
%52 = tail call i32 @readnb(i32 7, i32* %1, i8* %3)
%53 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %52)
%54 = tail call i32 @readnb(i32 8, i32* %1, i8* %3)
%55 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %54)
%56 = tail call i32 @readnb(i32 9, i32* %1, i8* %3)
%57 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = tail call i32 @readnb(i32 1, i32* %1, i8* %3)
%59 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %58)
%60 = tail call i32 @readnb(i32 0, i32* %1, i8* %3)
%61 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %60)
%62 = tail call i32 @readnb(i32 129, i32* %1, i8* %3)
%63 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %62)
%64 = tail call i32 @readnb(i32 127, i32* %1, i8* %3)
%65 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %64)
%66 = tail call i32 @readnb(i32 128, i32* %1, i8* %3)
%67 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i32 %66)
ret i32 0
}