#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("= Aufgabe 14.1 =\n");
  float x = 10.3;
  float y = 10.5;
  float z = 10.7;
  printf("Casting Float (%.1f, %.1f, %.1f) nach Int (%d, %d, %d)\n", x, y, z,
         (int)x, (int)y, (int)z);
  printf("= Aufgabe 14.2 =\n");
  int a = 255;
  signed char b = a;
  printf("Int (%d) nach Signed Char (%d) => Führende Bits werden abgeschnitten "
         "(int > signed char)\n",
         a, b);
  printf("= Aufgabe 14.3 =\n");
  printf("Ja\n");
  printf("= Aufgabe 14.4 =\n");
  int c = 115;
  printf("Ja, wenn die Zahl im ASCI bereich liegt (%d => %c)", c, c);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xeaa(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x18(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x1c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
cvttss2si -0x14(%rbp),%esi
cvttss2si -0x18(%rbp),%edx
cvttss2si -0x1c(%rbp),%ecx
lea    0xe92(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xff,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %al,-0x21(%rbp)
mov    -0x20(%rbp),%esi
movsbl -0x21(%rbp),%edx
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x73,-0x28(%rbp)
mov    -0x28(%rbp),%esi
mov    -0x28(%rbp),%edx
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2dd1(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xfb6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee4(%rip),%rdi
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
movsd  0xec4(%rip),%xmm2
mov    $0xa,%esi
mov    $0xa,%edx
mov    $0xa,%ecx
mov    $0x3,%al
call   1040 <printf@plt>
lea    0xf86(%rip),%rdi
call   1030 <puts@plt>
lea    0xedb(%rip),%rdi
mov    $0xff,%esi
mov    $0xffffffff,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf73(%rip),%rdi
call   1030 <puts@plt>
lea    0xf78(%rip),%rdi
call   1030 <puts@plt>
lea    0xf6f(%rip),%rdi
call   1030 <puts@plt>
lea    0xefa(%rip),%rdi
mov    $0x73,%esi
mov    $0x73,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"= Aufgabe 14.1 =\0A\00"
@.str.1 = [56 x i8] c"Casting Float (%.1f, %.1f, %.1f) nach Int (%d, %d, %d)\0A\00"
@.str.2 = [18 x i8] c"= Aufgabe 14.2 =\0A\00"
@.str.3 = [91 x i8] c"Int (%d) nach Signed Char (%d) => F\C3\BChrende Bits werden abgeschnitten (int > signed char)\0A\00"
@.str.4 = [18 x i8] c"= Aufgabe 14.3 =\0A\00"
@.str.5 = [4 x i8] c"Ja\0A\00"
@.str.6 = [18 x i8] c"= Aufgabe 14.4 =\0A\00"
@.str.7 = [51 x i8] c"Ja, wenn die Zahl im ASCI bereich liegt (%d => %c)\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca i32
%10 = alloca i8
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store float 0x40249999A0000000, float* %6
store float 1.050000e+01, float* %7
store float 0x4025666660000000, float* %8
%13 = load float, float* %6
%14 = fpext float %13 to double
%15 = load float, float* %7
%16 = fpext float %15 to double
%17 = load float, float* %8
%18 = fpext float %17 to double
%19 = load float, float* %6
%20 = fptosi float %19 to i32
%21 = load float, float* %7
%22 = fptosi float %21 to i32
%23 = load float, float* %8
%24 = fptosi float %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), double %14, double %16, double %18, i32 %20, i32 %22, i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i32 255, i32* %9
%27 = load i32, i32* %9
%28 = trunc i32 %27 to i8
store i8 %28, i8* %10
%29 = load i32, i32* %9
%30 = load i8, i8* %10
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str.3, i64 0, i64 0), i32 %29, i32 %31)
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
store i32 115, i32* %11
%36 = load i32, i32* %11
%37 = load i32, i32* %11
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0), i32 %36, i32 %37)
%39 = load i32, i32* @EXIT_SUCCESS
ret i32 %39
}

LLVM IR (-O2):
@.str.1 = [56 x i8] c"Casting Float (%.1f, %.1f, %.1f) nach Int (%d, %d, %d)\0A\00"
@.str.3 = [91 x i8] c"Int (%d) nach Signed Char (%d) => F\C3\BChrende Bits werden abgeschnitten (int > signed char)\0A\00"
@.str.7 = [51 x i8] c"Ja, wenn die Zahl im ASCI bereich liegt (%d => %c)\00"
@EXIT_SUCCESS = global i32 0
@str = [17 x i8] c"= Aufgabe 14.1 =\00"
@str.8 = [17 x i8] c"= Aufgabe 14.2 =\00"
@str.9 = [17 x i8] c"= Aufgabe 14.3 =\00"
@str.10 = [3 x i8] c"Ja\00"
@str.11 = [17 x i8] c"= Aufgabe 14.4 =\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), double 0x40249999A0000000, double 1.050000e+01, double 0x4025666660000000, i32 10, i32 10, i32 10)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str.3, i64 0, i64 0), i32 255, i32 -1)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.9, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.11, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.7, i64 0, i64 0), i32 115, i32 115)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}