#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*/ SEEK_END;
int /*<<< orphan*/ SEEK_SET;
int atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fread(char *, long, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
scalar_t__ isPunctuation(char);
char *malloc(long);
int /*<<< orphan*/ printf(char *, ...);
long rand();
int /*<<< orphan*/ srand(int);
int time(int /*<<< orphan*/ *);
int main(int argc, char **args) {
  if (argc == 1)
    srand((int)(time(NULL) / 100));
  else
    srand(atoi(args[1]));
  FILE *f = fopen("_PATH TO YOUR TEXT FILE_", "rb");
  fseek(f, 0, SEEK_END);
  long fsize = ftell(f);
  fseek(f, 0, SEEK_SET);
  char *string = malloc(fsize + 1);
  fread(string, fsize, 1, f);
  fclose(f);
  int randint = rand() % fsize;
  int start;
  for (long i = randint; i < fsize; i++) {
    if (string[i] == '.') {
      start = i + 1;
      break;
    }
  }
  for (long i = start; i < fsize; i++) {
    printf("%c", string[i]);
    if (isPunctuation(string[i]))
      break;
  }
  printf("\r\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    11fd <main+0x3d>
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%edi
call   1060 <srand@plt>
jmp    1211 <main+0x51>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,%edi
call   1060 <srand@plt>
lea    0xde8(%rip),%rdi
lea    0xdfa(%rip),%rsi
call   10c0 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2db5(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    0x2d84(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10b0 <fseek@plt>
mov    -0x20(%rbp),%rdi
add    $0x1,%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rcx
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
mov    $0x0,%al
call   10e0 <rand@plt>
cqto
idivq  -0x20(%rbp)
mov    %edx,%eax
mov    %eax,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    12f0 <main+0x130>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2e,%eax
jne    12da <main+0x11a>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %eax,-0x30(%rbp)
jmp    12f0 <main+0x130>
jmp    12df <main+0x11f>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    12a7 <main+0xe7>
movslq -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1356 <main+0x196>
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xd03(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x28(%rbp),%rax
mov    -0x40(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1080 <isPunctuation@plt>
cmp    $0x0,%rax
je     1340 <main+0x180>
jmp    1356 <main+0x196>
jmp    1345 <main+0x185>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    12f8 <main+0x138>
lea    0xcc2(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x1,%edi
jne    11fc <main+0x2c>
xor    %edi,%edi
call   10a0 <time@plt>
cltq
imul   $0x51eb851f,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
sar    $0x25,%rdi
add    %eax,%edi
jmp    1207 <main+0x37>
mov    0x8(%rsi),%rdi
call   10e0 <atoi@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    0xded(%rip),%rdi
lea    0xdff(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,%r15
mov    0x2dbf(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
mov    %r15,%rdi
call   1080 <ftell@plt>
mov    %rax,%r12
mov    0x2d91(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
xor    %esi,%esi
call   10c0 <fseek@plt>
lea    0x1(%r12),%rdi
call   10b0 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r12,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
call   1050 <fread@plt>
mov    %r15,%rdi
call   1060 <fclose@plt>
xor    %eax,%eax
call   10f0 <rand@plt>
mov    %rax,%rcx
or     %r12,%rcx
shr    $0x20,%rcx
je     1295 <main+0xc5>
cqto
idiv   %r12
jmp    129a <main+0xca>
xor    %edx,%edx
div    %r12d
movslq %edx,%rax
cmp    %r12,%rax
jge    12d3 <main+0x103>
movabs $0x100000000,%rcx
mov    %rax,%rbx
shl    $0x20,%rbx
add    %rcx,%rbx
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x2e,(%r14,%rax,1)
je     12dc <main+0x10c>
add    $0x1,%rax
add    %rcx,%rbx
cmp    %rax,%r12
jne    12c0 <main+0xf0>
xor    %ebx,%ebx
cmp    %r12,%rbx
jl     12e5 <main+0x115>
jmp    1315 <main+0x145>
sar    $0x20,%rbx
cmp    %r12,%rbx
jge    1315 <main+0x145>
add    $0x1,%rbx
nopl   0x0(%rax)
movsbl -0x1(%r14,%rbx,1),%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %ebp,%edi
call   1090 <isPunctuation@plt>
test   %rax,%rax
jne    1315 <main+0x145>
lea    0x1(%rbx),%rax
cmp    %r12,%rbx
mov    %rax,%rbx
jl     12f0 <main+0x120>
lea    0xd00(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"_PATH TO YOUR TEXT FILE_\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@.str.2 = [3 x i8] c"%c\00"
@.str.3 = [3 x i8] c"\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i64
%12 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %19
15: ; preds = %2
%16 = call i32 @time(i32* null)
%17 = sdiv i32 %16, 100
%18 = call i32 @srand(i32 %17)
br label %25
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 @atoi(i8* %22)
%24 = call i32 @srand(i32 %23)
br label %25
25: ; preds = %19, %15
%26 = call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %26, i32** %6
%27 = load i32*, i32** %6
%28 = load i32, i32* @SEEK_END
%29 = call i32 @fseek(i32* %27, i32 0, i32 %28)
%30 = load i32*, i32** %6
%31 = call i64 @ftell(i32* %30)
store i64 %31, i64* %7
%32 = load i32*, i32** %6
%33 = load i32, i32* @SEEK_SET
%34 = call i32 @fseek(i32* %32, i32 0, i32 %33)
%35 = load i64, i64* %7
%36 = add nsw i64 %35, 1
%37 = call i8* @malloc(i64 %36)
store i8* %37, i8** %8
%38 = load i8*, i8** %8
%39 = load i64, i64* %7
%40 = load i32*, i32** %6
%41 = call i32 @fread(i8* %38, i64 %39, i32 1, i32* %40)
%42 = load i32*, i32** %6
%43 = call i32 @fclose(i32* %42)
%44 = call i64 (...) @rand()
%45 = load i64, i64* %7
%46 = srem i64 %44, %45
%47 = trunc i64 %46 to i32
store i32 %47, i32* %9
%48 = load i32, i32* %9
%49 = sext i32 %48 to i64
store i64 %49, i64* %11
br label %50
50: ; preds = %66, %25
%51 = load i64, i64* %11
%52 = load i64, i64* %7
%53 = icmp slt i64 %51, %52
br i1 %53, label %54, label %69
54: ; preds = %50
%55 = load i8*, i8** %8
%56 = load i64, i64* %11
%57 = getelementptr inbounds i8, i8* %55, i64 %56
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 46
br i1 %60, label %61, label %65
61: ; preds = %54
%62 = load i64, i64* %11
%63 = add nsw i64 %62, 1
%64 = trunc i64 %63 to i32
store i32 %64, i32* %10
br label %69
65: ; preds = %54
br label %66
66: ; preds = %65
%67 = load i64, i64* %11
%68 = add nsw i64 %67, 1
store i64 %68, i64* %11
br label %50
69: ; preds = %61, %50
%70 = load i32, i32* %10
%71 = sext i32 %70 to i64
store i64 %71, i64* %12
br label %72
72: ; preds = %91, %69
%73 = load i64, i64* %12
%74 = load i64, i64* %7
%75 = icmp slt i64 %73, %74
br i1 %75, label %76, label %94
76: ; preds = %72
%77 = load i8*, i8** %8
%78 = load i64, i64* %12
%79 = getelementptr inbounds i8, i8* %77, i64 %78
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %81)
%83 = load i8*, i8** %8
%84 = load i64, i64* %12
%85 = getelementptr inbounds i8, i8* %83, i64 %84
%86 = load i8, i8* %85
%87 = call i64 @isPunctuation(i8 signext %86)
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %90
89: ; preds = %76
br label %94
90: ; preds = %76
br label %91
91: ; preds = %90
%92 = load i64, i64* %12
%93 = add nsw i64 %92, 1
store i64 %93, i64* %12
br label %72
94: ; preds = %89, %72
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"_PATH TO YOUR TEXT FILE_\00"
@.str.1 = [3 x i8] c"rb\00"
@SEEK_END = global i32 0
@SEEK_SET = global i32 0
@str = [2 x i8] c"\0D\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @time(i32* null)
%6 = sdiv i32 %5, 100
br label %11
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 1
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
br label %11
11: ; preds = %7, %4
%12 = phi i32 [ %10, %7 ], [ %6, %4 ]
%13 = tail call i32 @srand(i32 %12)
%14 = tail call i32* @fopen(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @SEEK_END
%16 = tail call i32 @fseek(i32* %14, i32 0, i32 %15)
%17 = tail call i64 @ftell(i32* %14)
%18 = load i32, i32* @SEEK_SET
%19 = tail call i32 @fseek(i32* %14, i32 0, i32 %18)
%20 = add nsw i64 %17, 1
%21 = tail call i8* @malloc(i64 %20)
%22 = tail call i32 @fread(i8* %21, i64 %17, i32 1, i32* %14)
%23 = tail call i32 @fclose(i32* %14)
%24 = tail call i64 (...) @rand()
%25 = srem i64 %24, %17
%26 = shl i64 %25, 32
%27 = ashr exact i64 %26, 32
%28 = icmp slt i64 %27, %17
br i1 %28, label %29, label %41
29: ; preds = %11, %38
%30 = phi i64 [ %39, %38 ], [ %27, %11 ]
%31 = getelementptr inbounds i8, i8* %21, i64 %30
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 46
br i1 %33, label %34, label %38
34: ; preds = %29
%35 = shl i64 %30, 32
%36 = add i64 %35, 4294967296
%37 = ashr exact i64 %36, 32
br label %41
38: ; preds = %29
%39 = add i64 %30, 1
%40 = icmp eq i64 %39, %17
br i1 %40, label %41, label %29
41: ; preds = %38, %11, %34
%42 = phi i64 [ %37, %34 ], [ 0, %11 ], [ 0, %38 ]
%43 = icmp slt i64 %42, %17
br i1 %43, label %44, label %55
44: ; preds = %41, %44
%45 = phi i64 [ %52, %44 ], [ %42, %41 ]
%46 = getelementptr inbounds i8, i8* %21, i64 %45
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = tail call i32 @putchar(i32 %48)
%50 = tail call i64 @isPunctuation(i8 signext %47)
%51 = icmp eq i64 %50, 0
%52 = add nsw i64 %45, 1
%53 = icmp slt i64 %52, %17
%54 = select i1 %51, i1 %53, i1 false
br i1 %54, label %44, label %55
55: ; preds = %44, %41
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}