#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 EOF;
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *);
int main() {
  FILE *fPtr;
  int i;
  char *s1[15] = {"char",  "unsigned char", "short int",  "unsigned short int",
                  "int",   "unsigned int",  "long int",   "unsigned long int",
                  "float", "double",        "long double"};
  if ((fPtr = fopen("datasize.dat", "w")) == NULL) {
    printf("File could not be opened\n");
  } else {
    fprintf(fPtr, "%-20s%5s\n", "Data type", "Size");
    fprintf(fPtr, "%-20s%5lu\n", s1[0], sizeof(char));
    fprintf(fPtr, "%-20s%5lu\n", s1[1], sizeof(unsigned char));
    fprintf(fPtr, "%-20s%5lu\n", s1[2], sizeof(short int));
    fprintf(fPtr, "%-20s%5lu\n", s1[3], sizeof(unsigned short int));
    fprintf(fPtr, "%-20s%5lu\n", s1[4], sizeof(int));
    fprintf(fPtr, "%-20s%5lu\n", s1[5], sizeof(unsigned int));
    fprintf(fPtr, "%-20s%5lu\n", s1[6], sizeof(long int));
    fprintf(fPtr, "%-20s%5lu\n", s1[7], sizeof(unsigned long int));
    fprintf(fPtr, "%-20s%5lu\n", s1[8], sizeof(float));
    fprintf(fPtr, "%-20s%5lu\n", s1[9], sizeof(double));
    fprintf(fPtr, "%-20s%5lu\n", s1[10], sizeof(long double));
    fprintf(fPtr, "%c", EOF);
  }
  fprintf(fPtr, "%s\n", "hello rewind");
  fclose(fPtr);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rdi
lea    0x2c30(%rip),%rsi
mov    $0x78,%edx
call   1060 <memcpy@plt>
lea    0xed1(%rip),%rdi
lea    0xed7(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    11ac <main+0x5c>
lea    0xebf(%rip),%rdi
call   1040 <printf@plt>
jmp    1316 <main+0x1c6>
mov    -0x10(%rbp),%rdi
lea    0xec4(%rip),%rsi
lea    0xec7(%rip),%rdx
lea    0xeca(%rip),%rcx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x90(%rbp),%rdx
lea    0xeb6(%rip),%rsi
mov    $0x1,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x88(%rbp),%rdx
lea    0xe98(%rip),%rsi
mov    $0x1,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x80(%rbp),%rdx
lea    0xe7d(%rip),%rsi
mov    $0x2,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x78(%rbp),%rdx
lea    0xe62(%rip),%rsi
mov    $0x2,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x70(%rbp),%rdx
lea    0xe47(%rip),%rsi
mov    $0x4,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x68(%rbp),%rdx
lea    0xe2c(%rip),%rsi
mov    $0x4,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x60(%rbp),%rdx
lea    0xe11(%rip),%rsi
mov    $0x8,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x58(%rbp),%rdx
lea    0xdf6(%rip),%rsi
mov    $0x8,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%rdx
lea    0xddb(%rip),%rsi
mov    $0x4,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rdx
lea    0xdc0(%rip),%rsi
mov    $0x8,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rdx
lea    0xda5(%rip),%rsi
mov    $0x10,%ecx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    0x2ce2(%rip),%rax
mov    (%rax),%edx
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xd81(%rip),%rsi
lea    0xd7e(%rip),%rdx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xef7(%rip),%rdi
lea    0xefd(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
je     12bf <main+0x16f>
lea    0xee7(%rip),%rsi
lea    0xeea(%rip),%rdx
lea    0xeed(%rip),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xee1(%rip),%r14
lea    0xe69(%rip),%rdx
mov    $0x1,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe47(%rip),%rdx
mov    $0x1,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe45(%rip),%rdx
mov    $0x2,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe23(%rip),%rdx
mov    $0x2,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe26(%rip),%rdx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe04(%rip),%rdx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xe01(%rip),%rdx
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xddf(%rip),%rdx
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdd8(%rip),%rdx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdca(%rip),%rdx
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
lea    0xdac(%rip),%rdx
mov    $0x10,%ecx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x2d35(%rip),%rax
mov    (%rax),%edi
mov    %rbx,%rsi
call   1050 <fputc@plt>
jmp    12cb <main+0x17b>
lea    0xdd0(%rip),%rdi
call   1030 <puts@plt>
lea    0xdb3(%rip),%rsi
lea    0xdb0(%rip),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"char\00"
@.str.1 = [14 x i8] c"unsigned char\00"
@.str.2 = [10 x i8] c"short int\00"
@.str.3 = [19 x i8] c"unsigned short int\00"
@.str.4 = [4 x i8] c"int\00"
@.str.5 = [13 x i8] c"unsigned int\00"
@.str.6 = [9 x i8] c"long int\00"
@.str.7 = [18 x i8] c"unsigned long int\00"
@.str.8 = [6 x i8] c"float\00"
@.str.9 = [7 x i8] c"double\00"
@.str.10 = [12 x i8] c"long double\00"
@__const.main.s1 = [15 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i32 0, i32 0), i8* null, i8* null, i8* null, i8* null]
@.str.11 = [13 x i8] c"datasize.dat\00"
@.str.12 = [2 x i8] c"w\00"
@.str.13 = [26 x i8] c"File could not be opened\0A\00"
@.str.14 = [10 x i8] c"%-20s%5s\0A\00"
@.str.15 = [10 x i8] c"Data type\00"
@.str.16 = [5 x i8] c"Size\00"
@.str.17 = [11 x i8] c"%-20s%5lu\0A\00"
@.str.18 = [3 x i8] c"%c\00"
@EOF = global i32 0
@.str.19 = [4 x i8] c"%s\0A\00"
@.str.20 = [13 x i8] c"hello rewind\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32
%4 = alloca [15 x i8*]
store i32 0, i32* %1
%5 = bitcast [15 x i8*]* %4 to i8*
%6 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
store i32* %6, i32** %2
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0))
br label %60
10: ; preds = %0
%11 = load i32*, i32** %2
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%13 = load i32*, i32** %2
%14 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 0
%15 = load i8*, i8** %14
%16 = call i32 (i32*, i8*, ...) @fprintf(i32* %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %15, i64 1)
%17 = load i32*, i32** %2
%18 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 1
%19 = load i8*, i8** %18
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %19, i64 1)
%21 = load i32*, i32** %2
%22 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 2
%23 = load i8*, i8** %22
%24 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %23, i64 2)
%25 = load i32*, i32** %2
%26 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 3
%27 = load i8*, i8** %26
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %27, i64 2)
%29 = load i32*, i32** %2
%30 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 4
%31 = load i8*, i8** %30
%32 = call i32 (i32*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %31, i64 4)
%33 = load i32*, i32** %2
%34 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 5
%35 = load i8*, i8** %34
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %35, i64 4)
%37 = load i32*, i32** %2
%38 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 6
%39 = load i8*, i8** %38
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %39, i64 8)
%41 = load i32*, i32** %2
%42 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 7
%43 = load i8*, i8** %42
%44 = call i32 (i32*, i8*, ...) @fprintf(i32* %41, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %43, i64 8)
%45 = load i32*, i32** %2
%46 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 8
%47 = load i8*, i8** %46
%48 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %47, i64 4)
%49 = load i32*, i32** %2
%50 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 9
%51 = load i8*, i8** %50
%52 = call i32 (i32*, i8*, ...) @fprintf(i32* %49, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %51, i64 8)
%53 = load i32*, i32** %2
%54 = getelementptr inbounds [15 x i8*], [15 x i8*]* %4, i64 0, i64 10
%55 = load i8*, i8** %54
%56 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* %55, i64 16)
%57 = load i32*, i32** %2
%58 = load i32, i32* @EOF
%59 = call i32 (i32*, i8*, ...) @fprintf(i32* %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.18, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %10, %8
%61 = load i32*, i32** %2
%62 = call i32 (i32*, i8*, ...) @fprintf(i32* %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%63 = load i32*, i32** %2
%64 = call i32 @fclose(i32* %63)
%65 = load i32, i32* %1
ret i32 %65
}

LLVM IR (-O2):
@.str = [5 x i8] c"char\00"
@.str.1 = [14 x i8] c"unsigned char\00"
@.str.2 = [10 x i8] c"short int\00"
@.str.3 = [19 x i8] c"unsigned short int\00"
@.str.4 = [4 x i8] c"int\00"
@.str.5 = [13 x i8] c"unsigned int\00"
@.str.6 = [9 x i8] c"long int\00"
@.str.7 = [18 x i8] c"unsigned long int\00"
@.str.8 = [6 x i8] c"float\00"
@.str.9 = [7 x i8] c"double\00"
@.str.10 = [12 x i8] c"long double\00"
@.str.11 = [13 x i8] c"datasize.dat\00"
@.str.12 = [2 x i8] c"w\00"
@.str.14 = [10 x i8] c"%-20s%5s\0A\00"
@.str.15 = [10 x i8] c"Data type\00"
@.str.16 = [5 x i8] c"Size\00"
@.str.17 = [11 x i8] c"%-20s%5lu\0A\00"
@EOF = global i32 0
@.str.19 = [4 x i8] c"%s\0A\00"
@.str.20 = [13 x i8] c"hello rewind\00"
@str = [25 x i8] c"File could not be opened\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
%2 = icmp eq i32* %1, null
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
br label %20
5: ; preds = %0
%6 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%7 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 1)
%8 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i64 1)
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i64 2)
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i64 2)
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i64 4)
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i64 4)
%13 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i64 8)
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i64 8)
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0), i64 4)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i64 8)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i64 16)
%18 = load i32, i32* @EOF
%19 = tail call i32 @fputc(i32 %18, i32* %1)
br label %20
20: ; preds = %5, %3
%21 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.20, i64 0, i64 0))
%22 = tail call i32 @fclose(i32* %1)
ret i32 0
}