#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*/ float_char;
typedef int /*<<< orphan*/ double_char;
typedef int /*<<< orphan*/ char_float;
typedef int /*<<< orphan*/ char_double;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *);
int main(int argc, char *argv[]) {
  FILE *cf;
  int is_packed = 1;
  int is_two = 1;
  int is_four = 1;
  int is_eight = 1;
  int is_sixteen = 1;
  struct {
    char a;
    float b;
  } char_float;
  struct {
    float b;
    char a;
  } float_char;
  struct {
    char a;
    double b;
  } char_double;
  struct {
    double b;
    char a;
  } double_char;
  int size, extent1, extent2;
  size = sizeof(char) + sizeof(float);
  extent1 = sizeof(char_float);
  extent2 = sizeof(float_char);
  if (size != extent1)
    is_packed = 0;
  if ((extent1 % 2) != 0 && (extent2 % 2) != 0)
    is_two = 0;
  if ((extent1 % 4) != 0 && (extent2 % 4) != 0)
    is_four = 0;
  if (sizeof(float) == 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0)
    is_eight = 0;
  ;
  size = sizeof(char) + sizeof(double);
  extent1 = sizeof(char_double);
  extent2 = sizeof(double_char);
  if (size != extent1)
    is_packed = 0;
  if ((extent1 % 2) != 0 && (extent2 % 2) != 0)
    is_two = 0;
  if ((extent1 % 4) != 0 && (extent2 % 4) != 0)
    is_four = 0;
  if (sizeof(double) == 8 && (extent1 % 8) != 0 && (extent2 % 8) != 0)
    is_eight = 0;
  ;
  is_sixteen = 0;
  if (is_sixteen) {
    is_eight = 0;
    is_four = 0;
    is_two = 0;
  }
  if (is_eight) {
    is_four = 0;
    is_two = 0;
  }
  if (is_four)
    is_two = 0;
  cf = fopen("ctest.out", "w");
  if (is_packed + is_two + is_four + is_eight + is_sixteen == 0) {
    fprintf(cf, "Could not determine alignment\n");
  } else {
    if (is_packed + is_two + is_four + is_eight + is_sixteen != 1) {
      fprintf(cf, "error!\n");
    } else {
      if (is_packed)
        fprintf(cf, "packed\n");
      if (is_two)
        fprintf(cf, "two\n");
      if (is_four)
        fprintf(cf, "four\n");
      if (is_eight)
        fprintf(cf, "eight\n");
      if (is_sixteen)
        fprintf(cf, "sixteen\n");
    }
  }
  fclose(cf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x1,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x5,-0x64(%rbp)
movl   $0x8,-0x68(%rbp)
movl   $0x8,-0x6c(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
je     1191 <main+0x61>
movl   $0x0,-0x1c(%rbp)
mov    -0x68(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c0 <main+0x90>
mov    -0x6c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11c0 <main+0x90>
movl   $0x0,-0x20(%rbp)
mov    -0x68(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11ef <main+0xbf>
mov    -0x6c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11ef <main+0xbf>
movl   $0x0,-0x24(%rbp)
movl   $0x9,-0x64(%rbp)
movl   $0x10,-0x68(%rbp)
movl   $0x10,-0x6c(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x68(%rbp),%eax
je     1217 <main+0xe7>
movl   $0x0,-0x1c(%rbp)
mov    -0x68(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1246 <main+0x116>
mov    -0x6c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1246 <main+0x116>
movl   $0x0,-0x20(%rbp)
mov    -0x68(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1275 <main+0x145>
mov    -0x6c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1275 <main+0x145>
movl   $0x0,-0x24(%rbp)
mov    -0x68(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     12a4 <main+0x174>
mov    -0x6c(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     12a4 <main+0x174>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
je     12ca <main+0x19a>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x28(%rbp)
je     12e2 <main+0x1b2>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     12f3 <main+0x1c3>
movl   $0x0,-0x20(%rbp)
lea    0xd06(%rip),%rdi
lea    0xd09(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
cmp    $0x0,%eax
jne    1337 <main+0x207>
mov    -0x18(%rbp),%rdi
lea    0xcdf(%rip),%rsi
call   1040 <fprintf@plt>
jmp    13f0 <main+0x2c0>
mov    -0x1c(%rbp),%eax
add    -0x20(%rbp),%eax
add    -0x24(%rbp),%eax
add    -0x28(%rbp),%eax
add    -0x2c(%rbp),%eax
cmp    $0x1,%eax
je     1364 <main+0x234>
mov    -0x18(%rbp),%rdi
lea    0xcd1(%rip),%rsi
call   1040 <fprintf@plt>
jmp    13eb <main+0x2bb>
cmpl   $0x0,-0x1c(%rbp)
je     137e <main+0x24e>
mov    -0x18(%rbp),%rdi
lea    0xcba(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x20(%rbp)
je     1398 <main+0x268>
mov    -0x18(%rbp),%rdi
lea    0xca8(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x24(%rbp)
je     13b2 <main+0x282>
mov    -0x18(%rbp),%rdi
lea    0xc93(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x28(%rbp)
je     13cc <main+0x29c>
mov    -0x18(%rbp),%rdi
lea    0xc7f(%rip),%rsi
call   1040 <fprintf@plt>
cmpl   $0x0,-0x2c(%rbp)
je     13e6 <main+0x2b6>
mov    -0x18(%rbp),%rdi
lea    0xc6c(%rip),%rsi
call   1040 <fprintf@plt>
jmp    13eb <main+0x2bb>
jmp    13f0 <main+0x2c0>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xecb(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xebe(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i8, float }
%struct.anon.0 = type { float, i8 }
%struct.anon.1 = type { i8, double }
%struct.anon.2 = type { double, i8 }
@.str = [10 x i8] c"ctest.out\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [31 x i8] c"Could not determine alignment\0A\00"
@.str.3 = [8 x i8] c"error!\0A\00"
@.str.4 = [8 x i8] c"packed\0A\00"
@.str.5 = [5 x i8] c"two\0A\00"
@.str.6 = [6 x i8] c"four\0A\00"
@.str.7 = [7 x i8] c"eight\0A\00"
@.str.8 = [9 x i8] c"sixteen\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.anon
%13 = alloca %struct.anon.0
%14 = alloca %struct.anon.1
%15 = alloca %struct.anon.2
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 1, i32* %7
store i32 1, i32* %8
store i32 1, i32* %9
store i32 1, i32* %10
store i32 1, i32* %11
store i32 5, i32* %16
store i32 8, i32* %17
store i32 8, i32* %18
%19 = load i32, i32* %16
%20 = load i32, i32* %17
%21 = icmp ne i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %2
store i32 0, i32* %7
br label %23
23: ; preds = %22, %2
%24 = load i32, i32* %17
%25 = srem i32 %24, 2
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %32
27: ; preds = %23
%28 = load i32, i32* %18
%29 = srem i32 %28, 2
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 0, i32* %8
br label %32
32: ; preds = %31, %27, %23
%33 = load i32, i32* %17
%34 = srem i32 %33, 4
%35 = icmp ne i32 %34, 0
br i1 %35, label %36, label %41
36: ; preds = %32
%37 = load i32, i32* %18
%38 = srem i32 %37, 4
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %41
40: ; preds = %36
store i32 0, i32* %9
br label %41
41: ; preds = %40, %36, %32
store i32 9, i32* %16
store i32 16, i32* %17
store i32 16, i32* %18
%42 = load i32, i32* %16
%43 = load i32, i32* %17
%44 = icmp ne i32 %42, %43
br i1 %44, label %45, label %46
45: ; preds = %41
store i32 0, i32* %7
br label %46
46: ; preds = %45, %41
%47 = load i32, i32* %17
%48 = srem i32 %47, 2
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = load i32, i32* %18
%52 = srem i32 %51, 2
%53 = icmp ne i32 %52, 0
br i1 %53, label %54, label %55
54: ; preds = %50
store i32 0, i32* %8
br label %55
55: ; preds = %54, %50, %46
%56 = load i32, i32* %17
%57 = srem i32 %56, 4
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %64
59: ; preds = %55
%60 = load i32, i32* %18
%61 = srem i32 %60, 4
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %64
63: ; preds = %59
store i32 0, i32* %9
br label %64
64: ; preds = %63, %59, %55
%65 = load i32, i32* %17
%66 = srem i32 %65, 8
%67 = icmp ne i32 %66, 0
br i1 %67, label %68, label %73
68: ; preds = %64
%69 = load i32, i32* %18
%70 = srem i32 %69, 8
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %73
72: ; preds = %68
store i32 0, i32* %10
br label %73
73: ; preds = %72, %68, %64
store i32 0, i32* %11
%74 = load i32, i32* %11
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %73
store i32 0, i32* %10
store i32 0, i32* %9
store i32 0, i32* %8
br label %77
77: ; preds = %76, %73
%78 = load i32, i32* %10
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %77
store i32 0, i32* %9
store i32 0, i32* %8
br label %81
81: ; preds = %80, %77
%82 = load i32, i32* %9
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %85
84: ; preds = %81
store i32 0, i32* %8
br label %85
85: ; preds = %84, %81
%86 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %86, i32** %6
%87 = load i32, i32* %7
%88 = load i32, i32* %8
%89 = add nsw i32 %87, %88
%90 = load i32, i32* %9
%91 = add nsw i32 %89, %90
%92 = load i32, i32* %10
%93 = add nsw i32 %91, %92
%94 = load i32, i32* %11
%95 = add nsw i32 %93, %94
%96 = icmp eq i32 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %85
%98 = load i32*, i32** %6
%99 = call i32 @fprintf(i32* %98, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %146
100: ; preds = %85
%101 = load i32, i32* %7
%102 = load i32, i32* %8
%103 = add nsw i32 %101, %102
%104 = load i32, i32* %9
%105 = add nsw i32 %103, %104
%106 = load i32, i32* %10
%107 = add nsw i32 %105, %106
%108 = load i32, i32* %11
%109 = add nsw i32 %107, %108
%110 = icmp ne i32 %109, 1
br i1 %110, label %111, label %114
111: ; preds = %100
%112 = load i32*, i32** %6
%113 = call i32 @fprintf(i32* %112, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %145
114: ; preds = %100
%115 = load i32, i32* %7
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %120
117: ; preds = %114
%118 = load i32*, i32** %6
%119 = call i32 @fprintf(i32* %118, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %120
120: ; preds = %117, %114
%121 = load i32, i32* %8
%122 = icmp ne i32 %121, 0
br i1 %122, label %123, label %126
123: ; preds = %120
%124 = load i32*, i32** %6
%125 = call i32 @fprintf(i32* %124, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %126
126: ; preds = %123, %120
%127 = load i32, i32* %9
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %132
129: ; preds = %126
%130 = load i32*, i32** %6
%131 = call i32 @fprintf(i32* %130, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0))
br label %132
132: ; preds = %129, %126
%133 = load i32, i32* %10
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %138
135: ; preds = %132
%136 = load i32*, i32** %6
%137 = call i32 @fprintf(i32* %136, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
br label %138
138: ; preds = %135, %132
%139 = load i32, i32* %11
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %138
%142 = load i32*, i32** %6
%143 = call i32 @fprintf(i32* %142, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0))
br label %144
144: ; preds = %141, %138
br label %145
145: ; preds = %144, %111
br label %146
146: ; preds = %145, %97
%147 = load i32*, i32** %6
%148 = call i32 @fclose(i32* %147)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type { i8, float }
%struct.anon.0 = type { float, i8 }
%struct.anon.1 = type { i8, double }
%struct.anon.2 = type { double, i8 }
@.str = [10 x i8] c"ctest.out\00"
@.str.1 = [2 x i8] c"w\00"
@.str.7 = [7 x i8] c"eight\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i64 6, i64 1, i32* %3)
%5 = tail call i32 @fclose(i32* %3)
ret i32 0
}