#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  struct {
    unsigned happy : 1;
    unsigned sad : 2;
    unsigned confused : 3;
    unsigned focused : 4;
    unsigned furious : 30;
  } fields;
  fields.happy = 0;
  fields.furious = 0x3fffffff;
  fields.sad = 1;
  fields.confused = 1;
  fields.focused = 1;
  printf("%u\n", fields.furious);
  fields.furious = 0x7fffffff;
  printf("%u\n", fields.furious);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    -0x10(%rbp),%ax
and    $0xfffe,%ax
or     $0x0,%ax
mov    %ax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0xc0000000,%eax
or     $0x3fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%ax
and    $0xfff9,%ax
or     $0x2,%ax
mov    %ax,-0x10(%rbp)
mov    -0x10(%rbp),%ax
and    $0xffc7,%ax
or     $0x8,%ax
mov    %ax,-0x10(%rbp)
mov    -0x10(%rbp),%ax
and    $0xfc3f,%ax
or     $0x40,%ax
mov    %ax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
and    $0x3fffffff,%esi
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
and    $0xc0000000,%eax
or     $0x3fffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
and    $0x3fffffff,%esi
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x3fffffff,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3fffffff,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.anon = type { i16, i32 }
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.anon
store i32 0, i32* %1
%3 = bitcast %struct.anon* %2 to i16*
%4 = load i16, i16* %3
%5 = and i16 %4, -2
%6 = or i16 %5, 0
store i16 %6, i16* %3
%7 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%8 = load i32, i32* %7
%9 = and i32 %8, -1073741824
%10 = or i32 %9, 1073741823
store i32 %10, i32* %7
%11 = bitcast %struct.anon* %2 to i16*
%12 = load i16, i16* %11
%13 = and i16 %12, -7
%14 = or i16 %13, 2
store i16 %14, i16* %11
%15 = bitcast %struct.anon* %2 to i16*
%16 = load i16, i16* %15
%17 = and i16 %16, -57
%18 = or i16 %17, 8
store i16 %18, i16* %15
%19 = bitcast %struct.anon* %2 to i16*
%20 = load i16, i16* %19
%21 = and i16 %20, -961
%22 = or i16 %21, 64
store i16 %22, i16* %19
%23 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%24 = load i32, i32* %23
%25 = and i32 %24, 1073741823
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%28 = load i32, i32* %27
%29 = and i32 %28, -1073741824
%30 = or i32 %29, 1073741823
store i32 %30, i32* %27
%31 = getelementptr inbounds %struct.anon, %struct.anon* %2, i32 0, i32 1
%32 = load i32, i32* %31
%33 = and i32 %32, 1073741823
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%u\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1073741823)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1073741823)
ret i32 0
}