#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 9 =\n");
  signed short s_short_min = -32768;
  signed short s_short_max = 32767;
  unsigned short u_short_min = 0;
  unsigned short u_short_max = 65535;
  printf("signed short => min: %d; max: %d\n", s_short_min, s_short_max);
  printf("unsigned short => min: %d; max: %d\n", u_short_min, u_short_max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movw   $0x8000,-0x12(%rbp)
movw   $0x7fff,-0x14(%rbp)
movw   $0x0,-0x16(%rbp)
movw   $0xffff,-0x18(%rbp)
movswl -0x12(%rbp),%esi
movswl -0x14(%rbp),%edx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzwl -0x16(%rbp),%esi
movzwl -0x18(%rbp),%edx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xece(%rip),%rdi
mov    $0xffff8000,%esi
mov    $0x7fff,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
xor    %esi,%esi
mov    $0xffff,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"= Aufgabe 9 =\0A\00"
@.str.1 = [34 x i8] c"signed short => min: %d; max: %d\0A\00"
@.str.2 = [36 x i8] c"unsigned short => min: %d; max: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i16
%7 = alloca i16
%8 = alloca i16
%9 = alloca i16
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
store i16 -32768, i16* %6
store i16 32767, i16* %7
store i16 0, i16* %8
store i16 -1, i16* %9
%11 = load i16, i16* %6
%12 = sext i16 %11 to i32
%13 = load i16, i16* %7
%14 = sext i16 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 %12, i32 %14)
%16 = load i16, i16* %8
%17 = zext i16 %16 to i32
%18 = load i16, i16* %9
%19 = zext i16 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %17, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [34 x i8] c"signed short => min: %d; max: %d\0A\00"
@.str.2 = [36 x i8] c"unsigned short => min: %d; max: %d\0A\00"
@str = [14 x i8] c"= Aufgabe 9 =\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), i32 -32768, i32 32767)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 65535)
ret i32 0
}