#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*/ sevenbitstruct;
typedef int /*<<< orphan*/ onecharstruct;
typedef int /*<<< orphan*/ emptystruct;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  struct {
  } emptystruct;
  struct {
    char content;
  } onecharstruct;
  struct {
    unsigned char foo : 7;
  } sevenbitstruct;
  printf("size of char: %d bytes\n", sizeof(char));
  printf("size of empty struct: %d bytes\n", sizeof(emptystruct));
  printf("size of struct with one char: %d bytes\n", sizeof(onecharstruct));
  printf("size of struct with 7bit (char) field: %d bytes\n",
         sizeof(sevenbitstruct));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xf0a(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
xor    %esi,%esi
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xf18(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.anon = type {}
%struct.anon.0 = type { i8 }
%struct.anon.1 = type { i8 }
@.str = [24 x i8] c"size of char: %d bytes\0A\00"
@.str.1 = [32 x i8] c"size of empty struct: %d bytes\0A\00"
@.str.2 = [40 x i8] c"size of struct with one char: %d bytes\0A\00"
@.str.3 = [49 x i8] c"size of struct with 7bit (char) field: %d bytes\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
%3 = alloca %struct.anon.0
%4 = alloca %struct.anon.1
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0)
%7 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 1)
%8 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}

LLVM IR (-O2):
%struct.anon = type {}
@.str = [24 x i8] c"size of char: %d bytes\0A\00"
@.str.1 = [32 x i8] c"size of empty struct: %d bytes\0A\00"
@.str.2 = [40 x i8] c"size of struct with one char: %d bytes\0A\00"
@.str.3 = [49 x i8] c"size of struct with 7bit (char) field: %d bytes\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i32 0)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), i32 1)
ret i32 0
}