#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 *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  FILE *ofPtr;
  if ((ofPtr = fopen("datasize.dat", "w")) == NULL) {
    printf("Error - unable to open file \"%s\"\n", argv[1]);
    return -1;
  }
  fprintf(ofPtr, "%-25s%5s\n", "Data Type", "Size");
  fprintf(ofPtr, "%-25s%5d\n", "char", sizeof(char));
  fprintf(ofPtr, "%-25s%5d\n", "unsigned char", sizeof(unsigned char));
  fprintf(ofPtr, "%-25s%5d\n", "short int", sizeof(short int));
  fprintf(ofPtr, "%-25s%5d\n", "unsigned short int",
          sizeof(unsigned short int));
  fprintf(ofPtr, "%-25s%5d\n", "int", sizeof(int));
  fprintf(ofPtr, "%-25s%5d\n", "unsigned int", sizeof(unsigned int));
  fprintf(ofPtr, "%-25s%5d\n", "long int", sizeof(long int));
  fprintf(ofPtr, "%-25s%5d\n", "unsigned long int", sizeof(unsigned long int));
  fprintf(ofPtr, "%-25s%5d\n", "float", sizeof(float));
  fprintf(ofPtr, "%-25s%5d\n", "double", sizeof(double));
  fprintf(ofPtr, "%-25s%5d\n", "long double", sizeof(long double));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
lea    0xeb9(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1187 <main+0x57>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    12f8 <main+0x1c8>
mov    -0x18(%rbp),%rdi
lea    0xe9f(%rip),%rsi
lea    0xea2(%rip),%rdx
lea    0xea5(%rip),%rcx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe98(%rip),%rsi
lea    0xea4(%rip),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe7a(%rip),%rsi
lea    0xe7d(%rip),%rdx
mov    $0x1,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe5c(%rip),%rsi
lea    0xe76(%rip),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe3e(%rip),%rsi
lea    0xe4f(%rip),%rdx
mov    $0x2,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe20(%rip),%rsi
lea    0xe4d(%rip),%rdx
mov    $0x4,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xe02(%rip),%rsi
lea    0xe26(%rip),%rdx
mov    $0x4,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xde4(%rip),%rsi
lea    0xe1e(%rip),%rdx
mov    $0x8,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xdc6(%rip),%rsi
lea    0xdf7(%rip),%rdx
mov    $0x8,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xda8(%rip),%rsi
lea    0xdeb(%rip),%rdx
mov    $0x4,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd8a(%rip),%rsi
lea    0xdd8(%rip),%rdx
mov    $0x8,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd6c(%rip),%rsi
lea    0xdb5(%rip),%rdx
mov    $0x10,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbp
lea    0xec2(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1050 <fopen@plt>
test   %rax,%rax
je     1294 <main+0x164>
mov    %rax,%rbx
lea    0xed4(%rip),%rsi
lea    0xed7(%rip),%rdx
lea    0xeda(%rip),%rcx
xor    %r14d,%r14d
mov    %rax,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xecb(%rip),%rbp
lea    0xed7(%rip),%rdx
mov    $0x1,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xeb5(%rip),%rdx
mov    $0x1,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xeb3(%rip),%rdx
mov    $0x2,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe91(%rip),%rdx
mov    $0x2,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe94(%rip),%rdx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe72(%rip),%rdx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe6f(%rip),%rdx
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe4d(%rip),%rdx
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe46(%rip),%rdx
mov    $0x4,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe38(%rip),%rdx
mov    $0x8,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe1a(%rip),%rdx
mov    $0x10,%ecx
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    12aa <main+0x17a>
mov    0x8(%rbp),%rsi
lea    0xd70(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"datasize.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [34 x i8] c"Error - unable to open file \22%s\22\0A\00"
@.str.3 = [10 x i8] c"%-25s%5s\0A\00"
@.str.4 = [10 x i8] c"Data Type\00"
@.str.5 = [5 x i8] c"Size\00"
@.str.6 = [10 x i8] c"%-25s%5d\0A\00"
@.str.7 = [5 x i8] c"char\00"
@.str.8 = [14 x i8] c"unsigned char\00"
@.str.9 = [10 x i8] c"short int\00"
@.str.10 = [19 x i8] c"unsigned short int\00"
@.str.11 = [4 x i8] c"int\00"
@.str.12 = [13 x i8] c"unsigned int\00"
@.str.13 = [9 x i8] c"long int\00"
@.str.14 = [18 x i8] c"unsigned long int\00"
@.str.15 = [6 x i8] c"float\00"
@.str.16 = [7 x i8] c"double\00"
@.str.17 = [12 x i8] c"long double\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %6
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %12)
store i32 -1, i32* %3
br label %39
14: ; preds = %2
%15 = load i32*, i32** %6
%16 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%17 = load i32*, i32** %6
%18 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %17, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 1)
%19 = load i32*, i32** %6
%20 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %19, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i64 1)
%21 = load i32*, i32** %6
%22 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i64 2)
%23 = load i32*, i32** %6
%24 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %23, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i64 2)
%25 = load i32*, i32** %6
%26 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 4)
%27 = load i32*, i32** %6
%28 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i64 4)
%29 = load i32*, i32** %6
%30 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %29, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i64 8)
%31 = load i32*, i32** %6
%32 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %31, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i64 8)
%33 = load i32*, i32** %6
%34 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %33, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i64 4)
%35 = load i32*, i32** %6
%36 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %35, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i64 8)
%37 = load i32*, i32** %6
%38 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i64 16)
store i32 0, i32* %3
br label %39
39: ; preds = %14, %9
%40 = load i32, i32* %3
ret i32 %40
}

LLVM IR (-O2):
@.str = [13 x i8] c"datasize.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [34 x i8] c"Error - unable to open file \22%s\22\0A\00"
@.str.3 = [10 x i8] c"%-25s%5s\0A\00"
@.str.4 = [10 x i8] c"Data Type\00"
@.str.5 = [5 x i8] c"Size\00"
@.str.6 = [10 x i8] c"%-25s%5d\0A\00"
@.str.7 = [5 x i8] c"char\00"
@.str.8 = [14 x i8] c"unsigned char\00"
@.str.9 = [10 x i8] c"short int\00"
@.str.10 = [19 x i8] c"unsigned short int\00"
@.str.11 = [4 x i8] c"int\00"
@.str.12 = [13 x i8] c"unsigned int\00"
@.str.13 = [9 x i8] c"long int\00"
@.str.14 = [18 x i8] c"unsigned long int\00"
@.str.15 = [6 x i8] c"float\00"
@.str.16 = [7 x i8] c"double\00"
@.str.17 = [12 x i8] c"long double\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = icmp eq i32* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i8* %7)
br label %22
9: ; preds = %2
%10 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i64 1)
%12 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i64 1)
%13 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i64 2)
%14 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i64 2)
%15 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i64 4)
%16 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), i64 4)
%17 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i64 8)
%18 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i64 8)
%19 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i64 4)
%20 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i64 8)
%21 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0), i64 16)
br label %22
22: ; preds = %9, %5
%23 = phi i32 [ -1, %5 ], [ 0, %9 ]
ret i32 %23
}