#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printbinary(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ stdin;
int main(void) {
  int wert;
  short x, u;
  x = 7;
  wert = 0;
  if (x & 0x1)
    wert = 1;
  printf("1. Wert: %d\n", wert);
  u = 256;
  wert = 0;
  if ((u & 0x7F00) && !(u & 0x8000))
    wert = 1;
  printf("2. Wert: %d\n", wert);
  u = 520;
  wert = 0;
  if (u & 0x0200)
    wert = 1;
  printf("3. Wert: %d\n", wert);
  x = 5;
  wert = 1;
  printbinary(x);
  printbinary(0xFF80);
  wert = !(x & 0xFF80);
  printf("4. Wert: %d\n", wert);
  u = 43;
  wert = 1;
  if (u & 0x3)
    wert = 0;
  printf("4. Wert: %d\n", wert);
  fflush(stdin);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x7,-0xa(%rbp)
movl   $0x0,-0x8(%rbp)
movswl -0xa(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1173 <main+0x33>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
movw   $0x100,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movswl -0xc(%rbp),%eax
and    $0x7f00,%eax
cmp    $0x0,%eax
je     11ba <main+0x7a>
movswl -0xc(%rbp),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
jne    11ba <main+0x7a>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
movw   $0x208,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movswl -0xc(%rbp),%eax
and    $0x200,%eax
cmp    $0x0,%eax
je     11ef <main+0xaf>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe21(%rip),%rdi
call   1030 <printf@plt>
movw   $0x5,-0xa(%rbp)
movl   $0x1,-0x8(%rbp)
movswl -0xa(%rbp),%edi
call   1060 <printbinary@plt>
mov    $0xff80,%edi
call   1060 <printbinary@plt>
movswl -0xa(%rbp),%eax
and    $0xff80,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xde6(%rip),%rdi
call   1030 <printf@plt>
movw   $0x2b,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
movswl -0xc(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
je     126a <main+0x12a>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xdb3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d68(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    $0x5,%edi
call   1060 <printbinary@plt>
mov    $0xff80,%edi
call   1060 <printbinary@plt>
lea    0xe98(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <printf@plt>
mov    0x2e3b(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"1. Wert: %d\0A\00"
@.str.1 = [13 x i8] c"2. Wert: %d\0A\00"
@.str.2 = [13 x i8] c"3. Wert: %d\0A\00"
@.str.3 = [13 x i8] c"4. Wert: %d\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i16
%4 = alloca i16
store i32 0, i32* %1
store i16 7, i16* %3
store i32 0, i32* %2
%5 = load i16, i16* %3
%6 = sext i16 %5 to i32
%7 = and i32 %6, 1
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %0
store i32 1, i32* %2
br label %10
10: ; preds = %9, %0
%11 = load i32, i32* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11)
store i16 256, i16* %4
store i32 0, i32* %2
%13 = load i16, i16* %4
%14 = sext i16 %13 to i32
%15 = and i32 %14, 32512
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %10
%18 = load i16, i16* %4
%19 = sext i16 %18 to i32
%20 = and i32 %19, 32768
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %17
store i32 1, i32* %2
br label %23
23: ; preds = %22, %17, %10
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %24)
store i16 520, i16* %4
store i32 0, i32* %2
%26 = load i16, i16* %4
%27 = sext i16 %26 to i32
%28 = and i32 %27, 512
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %23
store i32 1, i32* %2
br label %31
31: ; preds = %30, %23
%32 = load i32, i32* %2
%33 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %32)
store i16 5, i16* %3
store i32 1, i32* %2
%34 = load i16, i16* %3
%35 = sext i16 %34 to i32
%36 = call i32 @printbinary(i32 %35)
%37 = call i32 @printbinary(i32 65408)
%38 = load i16, i16* %3
%39 = sext i16 %38 to i32
%40 = and i32 %39, 65408
%41 = icmp ne i32 %40, 0
%42 = xor i1 %41, true
%43 = zext i1 %42 to i32
store i32 %43, i32* %2
%44 = load i32, i32* %2
%45 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %44)
store i16 43, i16* %4
store i32 1, i32* %2
%46 = load i16, i16* %4
%47 = sext i16 %46 to i32
%48 = and i32 %47, 3
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %51
50: ; preds = %31
store i32 0, i32* %2
br label %51
51: ; preds = %50, %31
%52 = load i32, i32* %2
%53 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %52)
%54 = load i32, i32* @stdin
%55 = call i32 @fflush(i32 %54)
%56 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"1. Wert: %d\0A\00"
@.str.1 = [13 x i8] c"2. Wert: %d\0A\00"
@.str.2 = [13 x i8] c"3. Wert: %d\0A\00"
@.str.3 = [13 x i8] c"4. Wert: %d\0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 1)
%4 = tail call i32 @printbinary(i32 5)
%5 = tail call i32 @printbinary(i32 65408)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 1)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 0)
%8 = load i32, i32* @stdin
%9 = tail call i32 @fflush(i32 %8)
%10 = tail call i32 (...) @getchar()
ret i32 0
}