#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*/ time_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
scalar_t__ fscanf(int /*<<< orphan*/ *, char *, char *, ...);
char *gimmestr(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char **argv) {
  FILE *fp;
  char p[32];
  char p0[32];
  char p1[32];
  char *s;
  char *file;
  file = NULL;
  if (argc != 2) {
    fprintf(stderr, "usage: qstring filename\n");
    return -1;
  }
  memset(p, 0, 32);
  memset(p0, 0, 32);
  memset(p1, 0, 32);
  fp = fopen(file, "r");
  while (fscanf(fp, "%s%s%s", p, p0, p1) != EOF)
    printf("%s %s %s\n", p, p0, p1);
  fclose(fp);
  memset(p, 0, 32);
  memset(p0, 0, 32);
  memset(p1, 0, 32);
  fp = fopen("myfile", "r");
  while (fscanf(fp, "%s", p) != EOF) {
    s = gimmestr(p);
    if (s)
      printf("%s\n", s);
    else
      printf("\"\"\n");
  }
  fclose(fp);
  printf("%lu\n", sizeof(time_t));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x90(%rbp)
cmpl   $0x2,-0x8(%rbp)
je     11bf <main+0x4f>
mov    0x2e33(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
call   1080 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1337 <main+0x1c7>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
mov    -0x90(%rbp),%rdi
lea    0xe1c(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    -0x60(%rbp),%rcx
lea    -0x80(%rbp),%r8
lea    0xdfe(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    0x2dbd(%rip),%rcx
cmp    (%rcx),%rax
je     1253 <main+0xe3>
lea    -0x40(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x80(%rbp),%rcx
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1206 <main+0x96>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    -0x60(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
lea    0xd99(%rip),%rdi
lea    0xd7f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x40(%rbp),%rdx
lea    0xd6d(%rip),%rsi
mov    $0x0,%al
call   1070 <fscanf@plt>
mov    0x2d28(%rip),%rcx
cmp    (%rcx),%rax
je     1314 <main+0x1a4>
lea    -0x40(%rbp),%rdi
call   1030 <gimmestr@plt>
mov    %rax,-0x88(%rbp)
cmpq   $0x0,-0x88(%rbp)
je     1301 <main+0x191>
mov    -0x88(%rbp),%rsi
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    130f <main+0x19f>
lea    0xd2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12a3 <main+0x133>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    0xd13(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x2,%edi
jne    12f8 <main+0x178>
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0x40(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0xe41(%rip),%rsi
xor    %edi,%edi
call   10a0 <fopen@plt>
mov    %rax,%r15
lea    0xe32(%rip),%rsi
mov    %rax,%rdi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x2de5(%rip),%rcx
cmp    (%rcx),%rax
je     1265 <main+0xe5>
lea    0xe13(%rip),%r14
mov    %rsp,%r12
lea    0x40(%rsp),%rbx
lea    0x20(%rsp),%rbp
lea    0xdf8(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
mov    %rbp,%r8
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x2d88(%rip),%rcx
cmp    (%rcx),%rax
jne    1230 <main+0xb0>
mov    %r15,%rdi
call   1050 <fclose@plt>
mov    %rsp,%rbp
xor    %r14d,%r14d
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0x40(%rsp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0x20(%rsp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1070 <memset@plt>
lea    0xd81(%rip),%rdi
lea    0xd67(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
lea    0xd5e(%rip),%rsi
mov    %rax,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
mov    0x2d13(%rip),%r13
cmp    0x0(%r13),%rax
jne    1325 <main+0x1a5>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xd49(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    1313 <main+0x193>
mov    0x2cd9(%rip),%rax
mov    (%rax),%edi
lea    0xcf8(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rsp,%rbp
lea    0xd09(%rip),%r15
lea    0xce9(%rip),%r12
jmp    1362 <main+0x1e2>
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1080 <fscanf@plt>
cmp    0x0(%r13),%rax
je     12db <main+0x15b>
mov    %rbp,%rdi
call   1030 <gimmestr@plt>
test   %rax,%rax
je     1340 <main+0x1c0>
mov    %rax,%rdi
jmp    1343 <main+0x1c3>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"usage: qstring filename\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"%s%s%s\00"
@EOF = global i64 0
@.str.3 = [10 x i8] c"%s %s %s\0A\00"
@.str.4 = [7 x i8] c"myfile\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [4 x i8] c"\22\22\0A\00"
@.str.8 = [5 x i8] c"%lu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca [32 x i8]
%8 = alloca [32 x i8]
%9 = alloca [32 x i8]
%10 = alloca i8*
%11 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %11
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 2
br i1 %13, label %14, label %17
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %3
br label %70
17: ; preds = %2
%18 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%19 = call i32 @memset(i8* %18, i32 0, i32 32)
%20 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%21 = call i32 @memset(i8* %20, i32 0, i32 32)
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%23 = call i32 @memset(i8* %22, i32 0, i32 32)
%24 = load i8*, i8** %11
%25 = call i32* @fopen(i8* %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %25, i32** %6
br label %26
26: ; preds = %34, %17
%27 = load i32*, i32** %6
%28 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%29 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%31 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %27, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %28, i8* %29, i8* %30)
%32 = load i64, i64* @EOF
%33 = icmp ne i64 %31, %32
br i1 %33, label %34, label %39
34: ; preds = %26
%35 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%36 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%37 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %35, i8* %36, i8* %37)
br label %26
39: ; preds = %26
%40 = load i32*, i32** %6
%41 = call i32 @fclose(i32* %40)
%42 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%43 = call i32 @memset(i8* %42, i32 0, i32 32)
%44 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%45 = call i32 @memset(i8* %44, i32 0, i32 32)
%46 = getelementptr inbounds [32 x i8], [32 x i8]* %9, i64 0, i64 0
%47 = call i32 @memset(i8* %46, i32 0, i32 32)
%48 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %48, i32** %6
br label %49
49: ; preds = %65, %39
%50 = load i32*, i32** %6
%51 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%52 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %50, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %51)
%53 = load i64, i64* @EOF
%54 = icmp ne i64 %52, %53
br i1 %54, label %55, label %66
55: ; preds = %49
%56 = getelementptr inbounds [32 x i8], [32 x i8]* %7, i64 0, i64 0
%57 = call i8* @gimmestr(i8* %56)
store i8* %57, i8** %10
%58 = load i8*, i8** %10
%59 = icmp ne i8* %58, null
br i1 %59, label %60, label %63
60: ; preds = %55
%61 = load i8*, i8** %10
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %61)
br label %65
63: ; preds = %55
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
br label %65
65: ; preds = %63, %60
br label %49
66: ; preds = %49
%67 = load i32*, i32** %6
%68 = call i32 @fclose(i32* %67)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 4)
store i32 0, i32* %3
br label %70
70: ; preds = %66, %14
%71 = load i32, i32* %3
ret i32 %71
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"usage: qstring filename\0A\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [7 x i8] c"%s%s%s\00"
@EOF = global i64 0
@.str.3 = [10 x i8] c"%s %s %s\0A\00"
@.str.4 = [7 x i8] c"myfile\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.8 = [5 x i8] c"%lu\0A\00"
@str = [3 x i8] c"\22\22\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [32 x i8]
%4 = alloca [32 x i8]
%5 = alloca [32 x i8]
%6 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 2
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %49
13: ; preds = %2
%14 = call i32 @memset(i8* %6, i32 0, i32 32)
%15 = call i32 @memset(i8* %7, i32 0, i32 32)
%16 = call i32 @memset(i8* %8, i32 0, i32 32)
%17 = call i32* @fopen(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %26, label %21
21: ; preds = %13, %21
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
%23 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %17, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %6, i8* %7, i8* %8)
%24 = load i64, i64* @EOF
%25 = icmp eq i64 %23, %24
br i1 %25, label %26, label %21
26: ; preds = %21, %13
%27 = call i32 @fclose(i32* %17)
%28 = call i32 @memset(i8* %6, i32 0, i32 32)
%29 = call i32 @memset(i8* %7, i32 0, i32 32)
%30 = call i32 @memset(i8* %8, i32 0, i32 32)
%31 = call i32* @fopen(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%32 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%33 = load i64, i64* @EOF
%34 = icmp eq i64 %32, %33
br i1 %34, label %46, label %35
35: ; preds = %26, %42
%36 = call i8* @gimmestr(i8* %6)
%37 = icmp eq i8* %36, null
br i1 %37, label %40, label %38
38: ; preds = %35
%39 = call i32 @puts(i8* %36)
br label %42
40: ; preds = %35
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %42
42: ; preds = %40, %38
%43 = call i64 (i32*, i8*, i8*, ...) @fscanf(i32* %31, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%44 = load i64, i64* @EOF
%45 = icmp eq i64 %43, %44
br i1 %45, label %46, label %35
46: ; preds = %42, %26
%47 = call i32 @fclose(i32* %31)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i64 4)
br label %49
49: ; preds = %46, %10
%50 = phi i32 [ -1, %10 ], [ 0, %46 ]
ret i32 %50
}