#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 main(int argc, char **argv) {
  printf("= Aufgabe 8.1 =\n");
  printf("1000 als HEX => 0x%X\n", 1000);
  printf("= Aufgabe 8.2 =\n");
  printf("Die Zahl 1 kann maximal um 31 Stellen nach links verschieben werden "
         "(1 << 31 = %d)\n",
         1 << 31);
  printf("= Aufgabe 8.3 =\n");
  printf("0xAA & 0xF => 0x%X\n", 0xAA & 0xF);
  printf("0xAA | 0xF => 0x%X\n", 0xAA | 0xF);
  printf("0xAA ^ 0xF => 0x%X\n", 0xAA ^ 0xF);
  printf("= Aufgabe 8.4 =\n");
  printf("Es kommt die Ausgangszahl wieder raus => (0xAA ^ 0xF) ^ 0xF = 0x%X",
         (0xAA ^ 0xF) ^ 0xF);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed6(%rip),%rdi
mov    $0x3e8,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x80000000,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0xa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf21(%rip),%rdi
mov    $0xaf,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf22(%rip),%rdi
mov    $0xa5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf26(%rip),%rdi
mov    $0xaa,%esi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xfc1(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x3e8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfb2(%rip),%rdi
call   1030 <puts@plt>
lea    0xec3(%rip),%rdi
mov    $0x80000000,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfa3(%rip),%rdi
call   1030 <puts@plt>
lea    0xef8(%rip),%rdi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0xaf,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0xa5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf6e(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
mov    $0xaa,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"= Aufgabe 8.1 =\0A\00"
@.str.1 = [22 x i8] c"1000 als HEX => 0x%X\0A\00"
@.str.2 = [17 x i8] c"= Aufgabe 8.2 =\0A\00"
@.str.3 = [84 x i8] c"Die Zahl 1 kann maximal um 31 Stellen nach links verschieben werden (1 << 31 = %d)\0A\00"
@.str.4 = [17 x i8] c"= Aufgabe 8.3 =\0A\00"
@.str.5 = [20 x i8] c"0xAA & 0xF => 0x%X\0A\00"
@.str.6 = [20 x i8] c"0xAA | 0xF => 0x%X\0A\00"
@.str.7 = [20 x i8] c"0xAA ^ 0xF => 0x%X\0A\00"
@.str.8 = [17 x i8] c"= Aufgabe 8.4 =\0A\00"
@.str.9 = [67 x i8] c"Es kommt die Ausgangszahl wieder raus => (0xAA ^ 0xF) ^ 0xF = 0x%X\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 1000)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([84 x i8], [84 x i8]* @.str.3, i64 0, i64 0), i32 -2147483648)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 175)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 165)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0), i32 170)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [22 x i8] c"1000 als HEX => 0x%X\0A\00"
@.str.3 = [84 x i8] c"Die Zahl 1 kann maximal um 31 Stellen nach links verschieben werden (1 << 31 = %d)\0A\00"
@.str.5 = [20 x i8] c"0xAA & 0xF => 0x%X\0A\00"
@.str.6 = [20 x i8] c"0xAA | 0xF => 0x%X\0A\00"
@.str.7 = [20 x i8] c"0xAA ^ 0xF => 0x%X\0A\00"
@.str.9 = [67 x i8] c"Es kommt die Ausgangszahl wieder raus => (0xAA ^ 0xF) ^ 0xF = 0x%X\00"
@str = [16 x i8] c"= Aufgabe 8.1 =\00"
@str.10 = [16 x i8] c"= Aufgabe 8.2 =\00"
@str.11 = [16 x i8] c"= Aufgabe 8.3 =\00"
@str.12 = [16 x i8] c"= Aufgabe 8.4 =\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 1000)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.10, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([84 x i8], [84 x i8]* @.str.3, i64 0, i64 0), i32 -2147483648)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.11, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 10)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 175)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 165)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.12, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([67 x i8], [67 x i8]* @.str.9, i64 0, i64 0), i32 170)
ret i32 0
}